/**
 * <p>Title: Common.java</p>
 * <p>Description: DoNotes</p>
 * @author WangJun
 * @date 2009/11/25 16:36:45
 * @version 1.0
 */
package net.donotes.util;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;

/**
 * @author WangJun
 *
 */
public class Common {
	public static Date getLocalDateTime(Date date) { 
		SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		sdf1.setTimeZone(TimeZone.getTimeZone("GMT+8"));
		try {
			return sdf2.parse(sdf1.format(date));
			//return sdf1.parse(sdf2.format(date));
			//return DateFormat.parse(sdf.format(date));
		} catch (ParseException e) {
			e.printStackTrace();
			return date;
		}
	}
}